package cn.tianjindong.blog.mapper;

import cn.tianjindong.blog.pojo.BlogUser;
import cn.tianjindong.blog.pojo.BlogUserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface BlogUserMapper {
    int countByExample(BlogUserExample example);

    int deleteByExample(BlogUserExample example);

    int deleteByPrimaryKey(Long id);

    int insert(BlogUser record);
    
    /**
     * 插入数据后返回自增主键
     * @param record
     * @return
     */
    int insertReturnID(BlogUser record);

    int insertSelective(BlogUser record);
    
    /**
     * 分页查询用户对象
     * @param startIndex
     * @param countItem
     * @return
     */
    List<BlogUser> getUserPageView(int startIndex, Integer countItem);

    List<BlogUser> selectByExample(BlogUserExample example);

    BlogUser selectByPrimaryKey(Long id);
    
    /**
     * 通过用户名或邮箱查询用户
     * @param username
     * @return
     */
    BlogUser selectByUsernameOrEmail(String username);

    int updateByExampleSelective(@Param("record") BlogUser record, @Param("example") BlogUserExample example);

    int updateByExample(@Param("record") BlogUser record, @Param("example") BlogUserExample example);

    int updateByPrimaryKeySelective(BlogUser record);

    int updateByPrimaryKey(BlogUser record);

}